package at.ac.tuwien.infosys.aic11.server;

import at.ac.tuwien.infosys.aic11.dto.Address;
import at.ac.tuwien.infosys.aic11.dto.BankTransfer;
import at.ac.tuwien.infosys.aic11.dto.Cheque;
import at.ac.tuwien.infosys.aic11.dto.DisbursementPreference;
import at.ac.tuwien.infosys.aic11.dto.Duration;
import at.ac.tuwien.infosys.aic11.dto.InterestRate;
import at.ac.tuwien.infosys.aic11.dto.InternalCustomer;
import at.ac.tuwien.infosys.aic11.dto.Money;
import at.ac.tuwien.infosys.aic11.dto.Offer;
import at.ac.tuwien.infosys.aic11.dto.Rating;
import at.ac.tuwien.infosys.aic11.dto.Warrantor;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;


/**
 * Created by IntelliJ IDEA.
 * User: gh
 * Date: 08.11.11
 * Time: 15:18
 * To change this template use File | Settings | File Templates.
 */
@SuppressWarnings("unused")
public class DataBase {
	private static  List<InternalCustomer>  customers = new ArrayList<InternalCustomer>();
	private static  List<Warrantor>  warrantors = new ArrayList<Warrantor>();
	static {

		Address a1 = new Address("id_a1", "karlsplatz", "wien", "314", "1",
				"1040");
		Address a2 = new Address("id_a2", "stephansplatz", "wien", "123", "2",
				"1010");
		Address a3 = new Address("id_a3", "getreidemarkt ", "wien", "456", "3",
				"1060");
		Address a4 = new Address("id_a4", "museumsplatz", "wien", "789", "4",
				"1070");
		Address a5 = new Address("id_a5", "linke wienzeile", "wien", "12", "5",
				"1040");

		DisbursementPreference dp1 = new Cheque("max mustermann");
		DisbursementPreference dp2 = new Cheque("apfel saft");
		DisbursementPreference dp3 = new BankTransfer("sparkasse", "12345",
				"5678");
		DisbursementPreference dp4 = new BankTransfer("volksbank", "34589",
				"7890");
		DisbursementPreference dp5 = new BankTransfer("bank austria", "89012",
				"2345");

		Rating r1 = new Rating("AAA");
		Rating r2 = new Rating("AA");
		Rating r3 = new Rating("AAMinus");
		Rating r4 = new Rating("APlus");
		Rating r5 = new Rating("A");

		Money m1 = new Money(30000, "eur");
		Money m2 = new Money(10000, "eur");
		Money m3 = new Money(5000, "eur");
		Money m4 = new Money(1000, "eur");
		Money m5 = new Money(500, "eur");

		Duration d1 = new Duration(15);
		Duration d2 = new Duration(10);
		Duration d3 = new Duration(8);
		Duration d4 = new Duration(5);
		Duration d5 = new Duration(3);

		InterestRate ir1 = new InterestRate(10);
		InterestRate ir2 = new InterestRate(8);
		InterestRate ir3 = new InterestRate(6.7);
		InterestRate ir4 = new InterestRate(5);
		InterestRate ir5 = new InterestRate(3.1);

		Offer o1 = new Offer((long) 2020, "das ist ein kommentar", ir1);
		Offer o2 = new Offer((long) 2030, "das ist kein kommentar", ir2);
		Offer o3 = new Offer((long) 2040, "mein glas ist leer", ir3);
		Offer o4 = new Offer((long) 2050, "ich fülle mein glas wieder auf", ir4);
		Offer o5 = new Offer((long) 2060, "bin wieder da", ir5);

		InternalCustomer c1 = new InternalCustomer(101, "Bill", "Gates", "DerDieDas",
				new BigDecimal(10000), a1, dp1);
		InternalCustomer c2 = new InternalCustomer(102, "Sissi", "Ghjk", "vonderalm",
				new BigDecimal(20000), a2, dp2);
		InternalCustomer c3 = new InternalCustomer(103, "Julia", "Hjkl", "sackbauer",
				new BigDecimal(40000), a3, dp3);
		InternalCustomer c4 = new InternalCustomer(104, "Predrag", "Jklö",
				"Drakula", new BigDecimal(50000), a4, dp4);
		InternalCustomer c5 = new InternalCustomer(105, "Conan", "Klöä",
				"DerBarbar", new BigDecimal(60000), a5, dp5);

		Warrantor w1 = new Warrantor(201, "Sepp", "Op", "Hagenberger", new BigDecimal(
				10000), a1, dp1);
		Warrantor w2 = new Warrantor(202, "Gregor", "Pü", "Hagleitner", new BigDecimal(
				10000), a1, dp1);
		Warrantor w3 = new Warrantor(203, "Susanna", "As", "Schiessmichtot", new BigDecimal(
				10000), a1, dp1);
		Warrantor w4 = new Warrantor(204, "Bert", "Olof", "Knut", new BigDecimal(
				10000), a1, dp1);
		Warrantor w5 = new Warrantor(205, "Bernhard", "Df", "Daniel", new BigDecimal(
				10000), a1, dp1);


		customers.add(c1);
		customers.add(c2);
		customers.add(c3);
		customers.add(c4);
		customers.add(c5);

		warrantors.add(w1);
		warrantors.add(w2);
		warrantors.add(w3);
		warrantors.add(w4);
		warrantors.add(w5);

	}

	public static List<InternalCustomer> getInternalCustomers(){
		return customers;
	}

	public static List<Warrantor> getWarrantors(){
		return warrantors;
	}
}
